/*
 * Copyright (c) 2019-2020, https://api.iot.10086.cn/(https://gitee.com/cmcc-iot-api/iot-card-open-application/).
 */
package cn.iot.card.open.terminal.service;

import cn.iot.card.open.pojo.page.LayuiPageFactory;
import cn.iot.card.open.terminal.dao.SmsMoRecordMapper;
import cn.iot.card.open.terminal.dto.SmsReceiveRecordDTO;
import cn.iot.card.open.terminal.model.SmsMoRecord;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 上行短信
 */
@Service
@Slf4j
public class SmsReceiveService extends ServiceImpl<SmsMoRecordMapper, SmsMoRecord> {

    /**
     * 查询上/下行短信记录
     *
     * @param msisdns
     * @param smsReceiveRecordDTO
     * @return 返回 layui page info
     * @throws Exception
     * @author zhanlele
     * @date 20200225 20:24:10
     * @modify 20200225 zhanlele v1.1 创建
     * @since v1.1
     */
    public Page<Map<String, Object>> selectSmsReceiveRecord(String[] msisdns, SmsReceiveRecordDTO smsReceiveRecordDTO) {
        Page page = LayuiPageFactory.defaultPage();
        String startDate = smsReceiveRecordDTO.getStartDate();
        String endDate = smsReceiveRecordDTO.getEndDate();
        return this.baseMapper.getSmsMoRecordList(page, msisdns, startDate, endDate);
    }
}
